<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding: 0;}
        .box{
            width: 100%;
            height: 600px;
            background: linear-gradient(to bottom,red, blue);
        }
        .box .player{
            padding-top: 100px;
        }
        .box .player p{
            color: lightcoral;
            font-size: 30px;
            text-align: center;
            font-weight: bold;
            margin-bottom: 10px;
        }
        .player a{
            color: lightskyblue;
            font-size: 20px;
            display: block;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="player">
            <p>欢迎玩家<span id="user"></span>来到幻月服务器</p>
            <p>这是一片充满挑战与冒险的大陆,请尽情探险吧!</p>
            <a href="login.html">退出大陆</a>
        </div>
    </div>
    <script>
        var oUser=document.querySelector("#user");
        // 查看登录者的用户名
        var oUserInfo=JSON.parse(sessionStorage.getItem("token"||'{}'));
        if(oUserInfo.name==undefined){
            location.href="login.html";
        }else{
            oUser.innerHTML=oUserInfo.name;
        }
    </script>
</body>
</html>